﻿@{
    ViewBag.Title = "DocDiscount";
    Layout = "~/Views/Shared/DocInfos.cshtml";
}

<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<link href="~/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/BootstrapSouce/js/jquery.min.js"></script>

<script src="~/BootstrapSouce/js/bootstrap.min.js"></script>

@model List<JMY_Models.T_Discount_Infos_Model>
<h2>DocDiscount</h2>
<div>
    <input type="button" value="添加优惠券" class="btn btn-success" onclick="dianji()" />
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <td>编号</td>
                <td>名称</td>
                <td>类型</td>
                <td>额度</td>
                <td>时间</td>
                <td>操作</td>
               
            </tr>
        </thead>
        <tbody>
            @{
                foreach (var item in Model)
                {
                    <tr>
                        <td id="txtid">@item.T_Discount_ID</td>
                        <td>@item.T_Discount_Name</td>
                        <td>@item.T_Discount_Type</td>
                        <td>@item.T_Discount_Limit</td>
                        <td>@item.T_Discount_CreateTime</td>
                        <td>
                            <a href="/DocInfos/DelDocDiscount?T_Discount_ID=@item.T_Discount_ID">删除</a>  <input type="button" id="btn1" value="修改" onclick="dianjiX(@item.T_Discount_ID)" />
                        </td>
                    </tr>
                }
            }
        </tbody>
    </table>
</div>
<div class="modal-dialog" role="document" style="float:left;display:none" id="oooo">

    <div class="modal-content">
        <form action="/DocInfos/AddDocDiscount" method="post">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="label_course"><strong>添加优惠卷</strong></h4>
            </div>
            <div class="modal-body">
                <div class="row form-group">
                    <div class="col-md-3 control-label">
                        <label for="Name" class="pull-right">优惠卷名称</label>
                    </div>
                    <div class="col-md-7 controls">
                        <input id="yhjmc" name="T_Discount_Name" class="form-control" type="text">
                    </div>
                </div>
                <div class="row form-group">
                    <div class="col-md-3 control-label">
                        <label for="Address" class="pull-right">优惠卷类型</label>
                    </div>
                    <div class="col-md-7 controls">
                        <select id="lx" class="form-control">
                            <option value="XJJ">现金卷</option>
                            <option value="ZKJ">折扣卷</option>
                        </select>
                    </div>
                </div>
                <div class="row form-group">
                    <div class="col-md-3 control-label">
                        <label for="Grade" class="pull-right">优惠额度</label>
                    </div>
                    <div class="col-md-7 controls">
                        <input id="ed" class="form-control" name="T_Discount_Limit" type="text">
                    </div>
                </div>
                <input id="curren_id" value="" type="hidden">
            </div>
            <div class="modal-footer">
                <div id="doing" style="float:left;display:none;">
                    <i class="fa fa-circle-o-notch fa-spin"></i><span> 处理中...</span>
                </div>
                <div id="success" style="float: left; display: none; ">
                    ]
                    <i class="fa fa-check-square"></i><span> 保存成功！</span>
                </div>
                <div id="error" style="float: left; display: none; ">
                    <i class="fa fa-warning"></i><span> 保存失败！</span>
                </div>
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="guan()">关闭</button>
                <button id="btn_add_hospital" type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
</div>
<script>
    function guna() {
        $("#oooo").css("display", "none");
    }
    function dianji() {

        $("#curren_id").val('');
        $("#yhjmc").val('');
        $("#lx").val('');
        $("#ed").val('');
        $("#oooo").modal('show');
    }

    function dianjiX(id)
    {
      
        location.href = "/DocInfos/FanTian?id=" + id;
    }


</script>

